package com.server.llh.llhserverwork.adapter;


import android.annotation.SuppressLint;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.ImageView;
import android.widget.TextView;

import com.llh.llhsuppliers.R;


public class LLHHomeNewAdatpter extends BaseAdapter {
	private String[] data ;
	private int[] id;
	private LayoutInflater lif = null;

	public LLHHomeNewAdatpter(Context context,int[] id,String[] data) {
		lif = LayoutInflater.from(context);
		this.id=id;
		this.data=data;
	}
	@Override
	public int getCount() {
		return data.length;
	}

	@Override
	public Object getItem(int arg0) {
		return arg0;
	}
	@Override
	public long getItemId(int arg0) {
		return arg0;
	}

	@SuppressLint({ "ViewHolder", "InflateParams" })
	@Override

	public View getView(int arg0, View arg1, ViewGroup arg2) {
		arg1 = lif.inflate(R.layout.llh_cammer_food_server_item, null);
		ImageView iv = (ImageView) arg1.findViewById(R.id.imag_server);
		iv.setImageResource(id[arg0]);
		TextView tv = (TextView) arg1.findViewById(R.id.list_item_btn1);
		tv.setText(data[arg0]);
		return arg1;
	}
}
